# _*_ coding utf-8 _*_
# FILENAME：.py
# DESCRIPTION: 零件信息 Model
# AUTH: ZB
# DATE: 2022/6/2 10:00 下午

from sqlalchemy import Column, String, Integer, DATETIME
from models.baseModel import BaseModel


## 零件主表
class PartsModel(BaseModel):
    # 表的名字:
    __tablename__ = 'parts'
    # 表的结构:
    production_line = Column(Integer, comment='生产线 1：焊装 2：涂装 3：总装')
    version_name = Column(String(255), index=True, comment='版本名称')
    factory_id = Column(Integer, comment='工厂ID')
    # 添加表注释
    __table_args__ = ({'comment': '零件主表'})


## 零件详情表
class PartsDetailsModel(BaseModel):
    # 表的名字:
    __tablename__ = 'parts_details'
    # 表的结构:
    parts_id = Column(Integer, index=True, comment='零件主表ID')
    code = Column(String(32), comment='零件件号')
    name = Column(String(64), comment='零件名称')
    lr_parts = Column(String(32), comment='左右件')
    loading_direction = Column(String(32), comment='装车朝向')
    factory = Column(String(64), comment='工厂')
    unloading_crossing = Column(String(16), comment='卸货道口')
    safety_stock = Column(Integer, comment='存储区安全库存')
    max_stock = Column(Integer, comment='存储区最大库存')
    supplier_name = Column(String(64), comment='供应商名称')
    packaging_type = Column(String(16), comment='包装类型')
    material_rack_pallet_adapted = Column(String(1), comment='料架是否能和托盘堆')
    length = Column(Integer, comment='长')
    width = Column(Integer, comment='宽')
    height = Column(Integer, comment='高')
    snp = Column(Integer, comment='单包装容量')
    # 添加表注释
    __table_args__ = ({'comment': '零件详情表'})

